using UnityEngine;
using UnityEngine.UI;

public class UIB_SliderListener_Script : MonoBehaviour
{
    private Slider slider;
    void Awake()
    {
        slider = GetComponent<Slider>();
    }

    private void Start()
    {
        slider.onValueChanged.AddListener(OnSliderValueChange);
    }

    private void OnSliderValueChange(float newValue)
    {
        Debug.Log("滑动条滑动了，新的滑动值：" + newValue);
    }
}